1. Technical Field
The present invention relates to a circuit device, an electro-optical device, and an electronic device, for example.
2. Related Art
In recent years, a circuit device to which a signal that is based on the result of detection is input from an environment sensor has been known. For example, a circuit device that performs processing to compare a signal from an environment sensor with a given reference signal can determine the relationship between the state of the surrounding environment and a given reference state based on the result of comparison.
For example, JP-A-2011-128219 discloses a display device that includes a temperature detector circuit that uses a comparator to compare a voltage that changes depending on the temperature with a reference voltage that corresponds to a given temperature. In the example discussed in JP-A-2011-128219, the environment sensor is a temperature sensor. JP-A-2011-128219 discloses an approach for detecting whether or not the temperature is greater than or equal to a set temperature using a temperature detector circuit, and when detecting an abnormality, controlling a source driver and a gate driver to eliminate the temperature abnormality.
When performing processing to compare a signal from an environment sensor with a given reference signal, the results is constant in most cases. In the example in which a high temperature abnormality is detected, the environment temperature is lower than the set temperature in most cases. As a result, the voltage level in the comparator circuit is at the same level in most cases, and the element will change over time (e.g. an offset will occur), which leads to degradation of comparison accuracy.
In view of this problem, it is expected that the voltage level can be prevented from being one-sided, and the offset can be improved by interchanging the two input signals to the compactor circuit (the signal from the environment sensor and the given reference signal) with each other as appropriate. When interchanging the input signals with each other, it is necessary to set the duration of a period (a detection period) in which two comparison operations, namely one before the interchange and one after the interchange, are performed, and the duration of a period between a given detection period and the subsequent detection period. There must be a desirable relationship between the durations of these periods, in terms of the reduction of the offset and the simplification of the configuration and the operations of the circuit device. However, the aforementioned related art does not disclose an approach for appropriately setting each of the periods.